//
//  MyViewController.m
//  HAODE
//
//  Created by panquanReabam.com on 15/9/8.
//  Copyright (c) 2015年 reabam.com. All rights reserved.
//


#import "MemberInformationViewController.h"
#import "TagView.h"
#import "MemberAddressViewController.h"
#import "SelectTag_NewViewController.h"
#import "TheEditingViewController.h"
@interface MemberInformationViewController ()<UITableViewDataSource,UITableViewDelegate,UIScrollViewDelegate, UITextViewDelegate,UIImagePickerControllerDelegate,UIAlertViewDelegate,UIGestureRecognizerDelegate,UINavigationControllerDelegate,UIActionSheetDelegate,TheEditingViewControllerDelegate>

{
    MJRefreshHeaderView* _header;
    MJRefreshFooterView* _footer;
    NSArray *array;
    NSArray *array1;
    NSArray *array2;
    NSArray *array3;
    UIButton* renzhenButton;
    NSString* userStatus;
    TagView*tagV;
    NSDictionary*Dict;
    NSMutableArray*selectTagNameArray;
    NSMutableArray*selectTagCodeArray;
    UITableView*table;
    
}

@end

@implementation MemberInformationViewController
@synthesize alt = alt;
@synthesize delegate;
-(void)BackAction:(UIButton *)sender{
    
    
    [self.navigationController popViewControllerAnimated:YES];
    
}
- (void)viewDidDisappear:(BOOL)animated

{
    
    [super viewDidDisappear:animated];
    
    
    
    self.navigationController.delegate = nil;
    
}

-(void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];

   
    [self setNavigation];
   
}



-(void)viewDidLoad{
    [super viewDidLoad];
    
    [self loadViewTabel];
    [self update];
    table = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, ScreenWidth, ScreenHeight) style:UITableViewStylePlain];
    table.delegate = self;
    table.dataSource = self;
    table.separatorStyle=UITableViewCellSeparatorStyleNone;
    [self.view addSubview:table];
  
 
   
   }
- (void)update
{
    selectTagNameArray=[[NSMutableArray alloc]init];
    selectTagCodeArray=[[NSMutableArray alloc]init];
    NSUserDefaults *user = [NSUserDefaults standardUserDefaults];
    NSString* Token = [user objectForKey:@"tokenId"];
    if (Token ==nil) {
        Token=@"dd";
    }
    NSMutableDictionary *param = [NSMutableDictionary new];
    [param setValue:Token forKey:@"tokenId"];
    [param setValue:self.memberId forKey:@"memberId"];
    
    [HttpRequest requestData:@"Business/Member/Detail" params:param success:^(BOOL isSuccess, SeverData *severDataDict) {
        if (isSuccess) {
            
            NSLog(@"33333333====%@",severDataDict.dataDict);
            if ([[severDataDict.dataDict objectForKey:@"ResultInt"] integerValue]==0) {
                [Global hideProgressHUDInternal:self.view];
                
                NSMutableArray* arrr=[[NSMutableArray alloc]init];
                Dict=[[NSDictionary alloc]init];
                Dict=severDataDict.dataDict ;
                arrr=[severDataDict.dataDict objectForKey:@"tags"];
                
                
                NSMutableArray* Codearrr=[[NSMutableArray alloc]init];
                NSMutableArray* Namearrr=[[NSMutableArray alloc]init];
                for (NSDictionary* dicc in arrr )
                {
                    [Codearrr addObject:[dicc valueForKey:@"code"]];
                    [Namearrr addObject:[dicc valueForKey:@"content"]];
                    
                    
                }
                
                selectTagNameArray=[Namearrr copy];
                selectTagCodeArray=[Codearrr copy];

                
                [self tableHeadView];
                
              
                [table reloadData];
                
                
            }else{
                [Global hideProgressHUDInternal:self.view];
                NSString *requestResultStr=[severDataDict.dataDict objectForKey:@"ResultString"];
                UIAlertView * alert = [[UIAlertView alloc]initWithTitle:@"温馨提示" message:requestResultStr delegate:self cancelButtonTitle:@"确定返回" otherButtonTitles: nil];
                [alert show];
                
            }
            
        }
        else
        {
            [Global hideProgressHUDInternal:self.view];
            
            [Global showTextHudSub:@"连接失败" view:self.view];
        }
        
    }];
    
}



- (void)loadViewTabel{

    array = @[@"编号",@"姓名",@"微信昵称",@"电话",@"性别",@"收货地址",@"标签"];
    [self tableHeadView];
}


- (void)tableHeadView
{
    
   
      UIView * tableFooterViews=[[UIView alloc]initWithFrame:CGRectMake(0, 0, ScreenWidth, 500)];
    
    if (selectTagCodeArray.count>0) {
        


        
        for (int i = 0,j = 0; i < selectTagCodeArray.count; i++) {
            if (i % 4 == 0) {
                j++;
            }
            
            tagV = [[TagView alloc]initWithFrame:CGRectMake(12.5+(ScreenWidth/4-5)*(i%4), (31*j)-23, ScreenWidth/4-15, 25)];
            tagV.buttonView.titleLabel.textAlignment=NSTextAlignmentCenter;
            tagV.buttonView.titleLabel.font=[UIFont systemFontOfSize:contenfot];
            [tagV.buttonView setTitle: [selectTagNameArray objectAtIndex:i]  forState:UIControlStateNormal];
            CGColorSpaceRef colorSpace2 = CGColorSpaceCreateDeviceRGB();
            CGColorRef colorref2 = CGColorCreate(colorSpace2,(CGFloat[]){209/255.0,170/255.0, 56/255.0, 1.0   });
            tagV.buttonView.backgroundColor=[UIColor colorWithRed:255/255.0 green:250/255.0 blue:234/255.0 alpha:1];
            [tagV.buttonView.layer setBorderColor:colorref2];//边框颜色
            
            [tagV.buttonView setTitleColor:[UIColor colorWithRed:207/255.0 green:170/255.0 blue:68/255.0 alpha:1] forState:0];
            [tableFooterViews addSubview:tagV];
            
        }
        
    
        
        UIView*huiseview=[[UIView alloc]initWithFrame:CGRectMake(0,tagV.bottom+9, ScreenWidth, 10)];
        huiseview.backgroundColor=zuiqianhuiColor;
        huiseview.layer.borderWidth = 0.3;
        huiseview.layer.borderColor = qianhuiColor.CGColor;
        [tableFooterViews addSubview:huiseview];
        UILabel*note=[[UILabel alloc]initWithFrame:CGRectMake(20, huiseview.bottom, 50, 50)];
        note.text=@"备注";
        note.font= [UIFont systemFontOfSize:16];
        [note setTextColor:[UIColor colorWithRed:53/255.0 green:53/255.0 blue:53/255.0 alpha:1]];
        [tableFooterViews addSubview:note];
        UIView*noteV=[[UIView alloc]initWithFrame:CGRectMake(0, note.bottom, ScreenWidth, 500)];
        noteV.backgroundColor=zuiqianhuiColor;
        noteV.layer.borderWidth = 0.3;
        noteV.layer.borderColor = qianhuiColor.CGColor;
        [tableFooterViews addSubview:noteV];
        renzhenButton=[[UIButton alloc]init];
        renzhenButton.backgroundColor=[UIColor clearColor];
        renzhenButton.frame=CGRectMake(ScreenWidth-38, huiseview.bottom+10, 33, 33);
        [renzhenButton setImage:[UIImage imageNamed:@"shouqi"] forState:UIControlStateNormal];
        [renzhenButton addTarget:self action:@selector(note:) forControlEvents:UIControlEventTouchUpInside];
        [tableFooterViews addSubview:renzhenButton];
        UIButton*Btn=[[UIButton alloc]init];
        Btn.backgroundColor=[UIColor clearColor];
        Btn.frame=CGRectMake(0, huiseview.bottom, ScreenWidth, 50);
        [Btn addTarget:self action:@selector(note:) forControlEvents:UIControlEventTouchUpInside];
        [tableFooterViews addSubview:Btn];
        UIImageView *_xianview = [[UIImageView alloc]initWithFrame:CGRectMake(15, 0, ScreenWidth-30, 0.3)];
        _xianview.image=[UIImage imageNamed:@"hengxian"];
        
        [tableFooterViews addSubview:_xianview];
    }else{
    
    
       
        UIView*huiseview=[[UIView alloc]initWithFrame:CGRectMake(0,0, ScreenWidth, 10)];
        huiseview.backgroundColor=zuiqianhuiColor;
        huiseview.layer.borderWidth = 0.3;
        huiseview.layer.borderColor = qianhuiColor.CGColor;
        [tableFooterViews addSubview:huiseview];
        UILabel*note=[[UILabel alloc]initWithFrame:CGRectMake(20, huiseview.bottom, 50, 50)];
        note.text=@"备注";
        note.font= [UIFont systemFontOfSize:16];
        [note setTextColor:[UIColor blackColor]];
        [tableFooterViews addSubview:note];
        UIView*noteV=[[UIView alloc]initWithFrame:CGRectMake(0, note.bottom, ScreenWidth, 500)];
        noteV.backgroundColor=zuiqianhuiColor;
        noteV.layer.borderWidth = 0.3;
        noteV.layer.borderColor = qianhuiColor.CGColor;
        [tableFooterViews addSubview:noteV];
        
        renzhenButton=[[UIButton alloc]init];
        renzhenButton.backgroundColor=[UIColor clearColor];
        renzhenButton.frame=CGRectMake(ScreenWidth-38, huiseview.bottom+10, 33, 33);
        [renzhenButton setImage:[UIImage imageNamed:@"shouqi"] forState:UIControlStateNormal];
        [renzhenButton addTarget:self action:@selector(note:) forControlEvents:UIControlEventTouchUpInside];
        [tableFooterViews addSubview:renzhenButton];
        
        UIButton*Btn=[[UIButton alloc]init];
        Btn.backgroundColor=[UIColor clearColor];
        Btn.frame=CGRectMake(0, huiseview.bottom, ScreenWidth, 50);
        [Btn addTarget:self action:@selector(note:) forControlEvents:UIControlEventTouchUpInside];
        [tableFooterViews addSubview:Btn];

    }
   table.tableFooterView = tableFooterViews;

}
-(void)note:(UIButton*)sender{
        TheEditingViewController * Login=[[TheEditingViewController alloc]init];
        Login.type=@"memo";
        Login.userNameStr=[NSString stringWithFormat:@"%@",[Dict objectForKey:@"userName"]];
        Login.sexStr=[NSString stringWithFormat:@"%@",[Dict objectForKey:@"sex"]];
        Login.memoStr=[NSString stringWithFormat:@"%@",[Dict objectForKey:@"memo"]];
        Login.titleName=@"备注";
        Login.delegate = self;
        [self.navigationController pushViewController:Login animated:YES];
}
- (void)secondViewController:(TheEditingViewController *)secondViewController updateUserNameText:(NSString *)userNameStr updateSexStr:(NSString *)sexStr updateMemoStr:(NSString *)memoStr
{
   
    
            NSUserDefaults *user = [NSUserDefaults standardUserDefaults];
            NSString* Token = [user objectForKey:@"tokenId"];
            NSMutableDictionary *params = [NSMutableDictionary new];
    
            [params setValue:Token forKey:@"tokenId"];
            [params setValue:self.memberId forKey:@"id"];
            [params setValue:userNameStr forKey:@"userName"];
            [params setValue:[Dict objectForKey:@"nickName"] forKey:@"nickName"];
            [params setValue:[Dict objectForKey:@"provinceName"] forKey:@"provinceName"];
            [params setValue:[Dict objectForKey:@"cityName"] forKey:@"cityName"];
            [params setValue:[Dict objectForKey:@"regionName"] forKey:@"regionName"];
            [params setValue:[Dict objectForKey:@"openId"] forKey:@"openId"];
            [params setValue:[Dict objectForKey:@"address"]  forKey:@"address"];
            [params setValue:[Dict objectForKey:@"phone"] forKey:@"phone"];
    
            NSMutableArray *mDocumentLine=[NSMutableArray array];
    
    
            for (int i=0; i<selectTagCodeArray.count; i++) {
    
                NSMutableDictionary *dic = [NSMutableDictionary dictionary];
                NSString *codeStr = [selectTagCodeArray objectAtIndex:i];
                [dic setValue:codeStr forKey:@"code"];
                [mDocumentLine addObject:dic];
}
    
            NSLog(@"====%@",mDocumentLine);
            [params setValue:mDocumentLine  forKey:@"tags"];
            [params setValue:sexStr forKey:@"sex"];
            [params setValue:memoStr forKey:@"memo"];
    
            NSLog(@"33333333====%@",params);
    
            [HttpRequest requestData:@"Business/Member/Add" params:params success:^(BOOL isSuccess, SeverData *severDataDict) {
                if (isSuccess) {
    
                    if ([[severDataDict.dataDict objectForKey:@"ResultInt"] integerValue]==0) {
                        [Global hideProgressHUDInternal:self.view];
                        
                        [delegate update:@""];
                        [self update];
                    
    
                    }else{
                      
                        NSString *requestResultStr=[severDataDict.dataDict objectForKey:@"ResultString"];
                        [Global showTextHudSub:requestResultStr view:self.view];
                    }
    
                }
                else
                {
                    [Global hideProgressHUDInternal:self.view];
                    
                    [Global showTextHudSub:@"连接失败" view:self.view];
                }
                
            }];
    
    
            
    
    
    
}


#pragma mark--TableViewDelegate

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return array.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"Cell";
    
    
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
    }
    
    cell.textLabel.font=[UIFont systemFontOfSize:titleNamefot];
    
    cell.textLabel.textColor=[UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1]
;
    cell.textLabel.text = [array objectAtIndex:indexPath.row];
    if ([[array objectAtIndex:indexPath.row]isEqualToString:@"编号"]) {
        
        UILabel*label=[[UILabel alloc]initWithFrame:CGRectMake(ScreenWidth-200, 0, 186, 50)];
        label.text=[NSString stringWithFormat:@"%@",[Dict objectForKey:@"cardNo"]];
        label.textAlignment=NSTextAlignmentRight;
        label.textColor=[UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1]; label.font=[UIFont systemFontOfSize:  15];
        [cell.contentView addSubview:label];
    
    }

    if ([[array objectAtIndex:indexPath.row]isEqualToString:@"姓名"]) {
        
        UILabel*label=[[UILabel alloc]initWithFrame:CGRectMake(ScreenWidth-205, 0, 160, 50)];
        label.text=[NSString stringWithFormat:@"%@",[Dict objectForKey:@"userName"]];
        label.textAlignment=NSTextAlignmentRight;
        label.textColor=zhonghuiColor; label.font=[UIFont systemFontOfSize:  15];
        [cell.contentView addSubview:label];
        UIButton*jiantou = [[UIButton alloc]init];
        jiantou.frame = CGRectMake(ScreenWidth-30,18, 8, 13);
        [jiantou setImage:[UIImage imageNamed:@"xiangzuo-.png"] forState:UIControlStateNormal];
        [cell.contentView addSubview:jiantou];
    }
    if ([[array objectAtIndex:indexPath.row]isEqualToString:@"微信昵称"]) {
        UILabel*label=[[UILabel alloc]initWithFrame:CGRectMake(ScreenWidth-205, 0, 160, 50)];
        label.text=[NSString stringWithFormat:@"%@",[Dict objectForKey:@"nickName"]];
        label.textAlignment=NSTextAlignmentRight;
        label.textColor=zhonghuiColor;
        label.font=[UIFont systemFontOfSize:  15];
        [cell.contentView addSubview:label];

    }

    if ([[array objectAtIndex:indexPath.row]isEqualToString:@"电话"]) {
        UILabel*label=[[UILabel alloc]initWithFrame:CGRectMake(ScreenWidth-205, 0, 160, 50)];
        label.text=[NSString stringWithFormat:@"%@",[Dict objectForKey:@"phone"]];
        label.textAlignment=NSTextAlignmentRight;
        label.textColor=zhonghuiColor;
         label.font=[UIFont systemFontOfSize:  15];
        [cell.contentView addSubview:label];

    }
    if ([[array objectAtIndex:indexPath.row]isEqualToString:@"性别"]) {
        UILabel*label=[[UILabel alloc]initWithFrame:CGRectMake(ScreenWidth-205, 0, 160, 50)];
        label.text=[NSString stringWithFormat:@"%@",[Dict objectForKey:@"sex"]];
        label.textAlignment=NSTextAlignmentRight;
        label.textColor=zhonghuiColor;
        label.font=[UIFont systemFontOfSize:  15];
        [cell.contentView addSubview:label];
        UIButton*jiantou = [[UIButton alloc]init];
        jiantou.frame = CGRectMake(ScreenWidth-30,18, 8, 13);
        [jiantou setImage:[UIImage imageNamed:@"xiangzuo-.png"] forState:UIControlStateNormal];
        [cell.contentView addSubview:jiantou];
    }
    if ([[array objectAtIndex:indexPath.row]isEqualToString:@"收货地址"]) {        UILabel*label=[[UILabel alloc]initWithFrame:CGRectMake(ScreenWidth-205, 0, 160, 50)];
        label.text=[NSString stringWithFormat:@"%@",[Dict objectForKey:@"addrQty"]];

        label.textAlignment=NSTextAlignmentRight;
        label.textColor=zhonghuiColor; label.font=[UIFont systemFontOfSize:  15];
        [cell.contentView addSubview:label];
        UIButton*jiantou = [[UIButton alloc]init];
        jiantou.frame = CGRectMake(ScreenWidth-30,18, 8, 13);
        [jiantou setImage:[UIImage imageNamed:@"xiangzuo-.png"] forState:UIControlStateNormal];
        [cell.contentView addSubview:jiantou];
    }
   if ([[array objectAtIndex:indexPath.row]isEqualToString:@"标签"]) {
        UILabel*label=[[UILabel alloc]initWithFrame:CGRectMake(ScreenWidth-205, 0, 160, 50)];
        label.text=[NSString stringWithFormat:@"已选择%ld个",[[Dict objectForKey:@"tags"]count]];
        label.textAlignment=NSTextAlignmentRight;
        label.textColor=hongseColor; label.font=[UIFont systemFontOfSize:  14];
        [cell.contentView addSubview:label];
       UIButton*jiantou = [[UIButton alloc]init];
       jiantou.frame = CGRectMake(ScreenWidth-30,18, 8, 13);
       [jiantou setImage:[UIImage imageNamed:@"xiangzuo-.png"] forState:UIControlStateNormal];
       [cell.contentView addSubview:jiantou];

   }
    
    if (array.count !=indexPath.row+1) {
        UILabel *lineLabel1=[[UILabel alloc] initWithFrame:CGRectMake(15, 50-0.35, ScreenWidth-30, 0.3)];
        lineLabel1.backgroundColor=qianhuiColor;
        [cell.contentView addSubview:lineLabel1];
        
    }
    
   
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
    UITableViewCell *cell =(UITableViewCell *)[tableView cellForRowAtIndexPath:indexPath];
    if ([cell.textLabel.text isEqualToString:@"姓名"]) {
        
        TheEditingViewController * Login=[[TheEditingViewController alloc]init];
        Login.type=@"userName";
        Login.userNameStr=[NSString stringWithFormat:@"%@",[Dict objectForKey:@"userName"]];
        Login.sexStr=[NSString stringWithFormat:@"%@",[Dict objectForKey:@"sex"]];
        Login.memoStr=[NSString stringWithFormat:@"%@",[Dict objectForKey:@"memo"]];
        Login.titleName=@"姓名";
        Login.delegate = self;
        [self.navigationController pushViewController:Login animated:YES];
        
    }
    if ([cell.textLabel.text isEqualToString:@"电话"]) {
        
    }
    if ([cell.textLabel.text isEqualToString:@"性别"]) {
        TheEditingViewController * Login=[[TheEditingViewController alloc]init];
        Login.type=@"sex";
        Login.userNameStr=[NSString stringWithFormat:@"%@",[Dict objectForKey:@"userName"]];
        Login.sexStr=[NSString stringWithFormat:@"%@",[Dict objectForKey:@"sex"]];
        Login.memoStr=[NSString stringWithFormat:@"%@",[Dict objectForKey:@"memo"]];
        Login.titleName=@"性别";
        Login.delegate = self;
        [self.navigationController pushViewController:Login animated:YES];
        
        
    }
    
    if ([cell.textLabel.text isEqualToString:@"收货地址"]) {
    
        
        MemberAddressViewController *detailViewController = [[MemberAddressViewController alloc] init];
        detailViewController.memberId=self.memberId;
        detailViewController.userName=[NSString stringWithFormat:@"%@",[Dict objectForKey:@"userName"]];
        detailViewController.phone=[NSString stringWithFormat:@"%@",[Dict objectForKey:@"phone"]];
        detailViewController.sex=[NSString stringWithFormat:@"%@",[Dict objectForKey:@"sex"]];
        [self.navigationController pushViewController:detailViewController animated:YES];

        
        
    }
    if ([cell.textLabel.text isEqualToString:@"标签"]) {
        SelectTag_NewViewController *detailViewController = [[SelectTag_NewViewController alloc] init];
        detailViewController.optionNameString=@"MemberTag";
        detailViewController.selectedTagCodeArray=selectTagCodeArray;
        detailViewController.selectedTagNameArray=selectTagNameArray;
        [self.navigationController pushViewController:detailViewController animated:YES];
        
        
    }
       }
- (CGFloat) tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    
     if (array.count==0) {
        return 118/2;
    }
    return  50;
}





- (void)showAlertWait
{
    alt = [[UIAlertView alloc] initWithTitle:@"网络不稳定 ！" message:@"请确认网络" delegate:self cancelButtonTitle:nil otherButtonTitles: nil];
    [alt show];
    
    [self performSelector:@selector(hideAlert) withObject:nil afterDelay:1.0f];
    
}

- (void)showAlertMessage:(NSString *)msg
{
    alt = [[UIAlertView alloc] initWithTitle:@"温馨提示" message:msg delegate:nil cancelButtonTitle:nil otherButtonTitles: nil];
    [alt show];
    
    [self performSelector:@selector(hideAlert) withObject:nil afterDelay:1.0f];
}
- (void)hideAlert
{
    if (alt != nil)
    {
        [alt dismissWithClickedButtonIndex:0 animated:YES];
        alt = nil;
    }
}
-(void)setNavigation{
    
    [[self rdv_tabBarController] setTabBarHidden:YES];
    self.navigationController.navigationBarHidden=NO;
    self.navigationController.navigationBar.barStyle = UIBaselineAdjustmentNone;
    UILabel *lineLabel=[[UILabel alloc] initWithFrame:CGRectMake(0, 43,ScreenWidth, 1)];
    [lineLabel setBackgroundColor:[UIColor colorWithRed:238.0/255.0 green:238.0/255.0 blue:238.0/255.0 alpha:1.0]];
    [self.navigationController.navigationBar addSubview:lineLabel];
    [self.navigationController.navigationBar setTintColor:[UIColor whiteColor]];
    [[UINavigationBar appearance] setBarTintColor:Color];
    
    UIImage* backImage = [UIImage imageNamed:@"fanhui"];
    CGRect backframe = CGRectMake(0,0,30,30);
    
    UIButton* backButton= [[UIButton alloc] initWithFrame:backframe];
    [backButton setBackgroundImage:backImage forState:UIControlStateNormal];
    backButton.titleLabel.font=[UIFont systemFontOfSize:13];
    [backButton addTarget:self action:@selector(BackAction:) forControlEvents:UIControlEventTouchUpInside];
    UIBarButtonItem* leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:backButton];
    self.navigationItem.leftBarButtonItem = leftBarButtonItem;
    self.navigationController.delegate = self;
    
    self.navigationController.interactivePopGestureRecognizer.delegate = self;
    self.title = @"会员基本详情";
    
    [self.navigationController.navigationBar setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:
                                                                     backColor,
                                                                     UITextAttributeTextColor,
                                                                     [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:1],
                                                                     UITextAttributeTextShadowColor,
                                                                     [NSValue valueWithUIOffset:UIOffsetMake(0, 0)],
                                                                     UITextAttributeTextShadowOffset,
                                                                     [UIFont fontWithName:@"Helvetica Neue" size:tetlefot],
                                                                     UITextAttributeFont,nil]];
    
    
    
}

@end
